<?php include "../public/header.php";?>
<?php include "../public/header_show.php";?>
<body id="xiangqingPage">
<div id="xiangqingBox">
    <div class="page-title">
        <div class="page-title-con">
            <span class="pageshowtitle">详情</span>
            <div class="page-title-opt-list">
                <?php include "../public_flow/flow_show_optbut.php";?>
                <button class="layui-btn layui-btn-sm btn-light marginr5 opt">
                    操作<i class="layui-icon layui-icon-down layui-font-12"></i>
                </button>
                <span id="page-close" class="page-close" onclick="layer_close()">×</span>
            </div>
        </div>
    </div>
    <div class="main-container">
        <div><?php include "../public_flow/flow_show_info.php";?></div>
        <div class="tongbox tongbox5">
            <div class="tuo"><div class="tit">项目名称</div><div class="con" id="tong_enginname"></div></div>
            <div class="tuo"><div class="tit">联营方/委托方</div><div class="con" id="tong_lian_unit"></div></div>
            <div class="tuo"><div class="tit">退税单号</div><div class="con" id="tong_number"></div></div>
            <div class="tuo"><div class="tit">本次退税金额合计(元)</div><div class="con" id="tong_money"></div></div>
            <div class="tuo"><div class="tit">收款方</div><div class="con" id="tong_duier"></div></div>
        </div>
        <div class="table-box tablenes">
            <div class="title">项目信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">项目名称</td><td class="tv colorlan" id="enginid_name"></td><td class="tt">已扣收税费(元) A</td><td class="tv" id="kou_shuifee"></td></tr>
                <tr><td class="tt">累计进项票(价税合计)(元)</td><td class="tv" id="shou_money"></td><td class="tt">累计进项票(专票)税额(元) B</td><td class="tv" id="shou_ratefee_zhuan"></td></tr>
                <tr><td class="tt">累计已退进项税额(元) C</td><td class="tv" id="zhijintuifee"></td><td class="tt">剩余可退进项税额(元)</td><td class="tv" id="shengjintuifee"></td></tr>
                </tbody>
            </table>
        </div>

        <div class="table-box tablenes">
            <div class="title">本次退税信息</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">退税单号</td><td class="tv" id="number"></td><td class="tt">款项类型</td><td class="tv" id="feilei_name"></td></tr>
                <tr><td class="tt">费用项</td><td class="tv" id="feitype_name"></td><td class="tt">款项摘要</td><td class="tv" id="zhai"></td></tr>
                <tr><td class="tt">本次退税金额合计(元)</td><td class="tv" id="money" colspan="3"></td></tr>
                <tr><td class="tt">支付方式</td><td class="tv" id="incdaotype_name"></td><td class="tt">收款方</td><td class="tv" id="duier"></td></tr>
                <tr><td class="tt">账户账号</td><td class="tv" id="banknum"></td><td class="tt">开户行</td><td class="tv" id="bankname"></td></tr>
                <tr><td class="tt">备注</td><td class="tv" id="explain" colspan="3"></td></tr>
                </tbody>
            </table>
        </div>


        <div class="table-box tablenes">
            <div class="title">支付信息(出纳)</div>
            <table class="layui-table">
                <tbody>
                <tr><td class="tt">支付状态</td><td class="tv" id="paystate_name"></td><td class="tt">最近支付日期</td><td class="tv" id="paylastdt"></td></tr>
                <tr><td class="tt">已支付金额(元)</td><td class="tv" id="payfee"></td><td class="tt">未支付金额(元)</td><td class="tv" id="paynofee"></td></tr>
                </tbody>
            </table>
        </div>
        <div><?php include "../public/upinfo_show.php";?></div>

        <div><?php include "../public_flow/flow_show_flowrelas.php";?></div>

        <div class="table-box tablenes">
            <script type="text/html" id="toolbarDemo_list">本次退税进项票明细</script>
            <div class="tableShow">
                <table id="datalist_list" lay-filter="datalist_list"></table>
            </div>
        </div>


        <div><?php include '../public_flow/flow_show_shenlog.php'?></div>
        <div><?php include '../public_flow/flow_show_talk.php'?></div>
        <div><?php include '../public/opt_browse.php'?></div>
    </div>


    <div class="showrrboxtext">
        <div class="table-box tablenes">
            <div class="title">项目税费扣收信息</div>
            <div class="tuo"><div class="tit">已扣收税费(元)</div><div class="con" id="right_kou_shuifee">0</div></div>
        </div>
        <div class="table-box tablenes">
            <div class="title">项目进项退税信息</div>
            <div class="tuo"><div class="tit">累计进项票(价税合计)(元)</div><div class="con" id="right_shou_money">0</div></div>
            <div class="tuo"><div class="tit">累计进项票(专票)(元)</div><div class="con" id="right_shou_ratefee_zhuan">0</div></div>
            <div class="tuo"><div class="tit">累计已退进项税额(元)</div><div class="con" id="right_zhijintuifee">0</div></div>
            <div class="tuo"><div class="tit">剩余可退进项税额(元)</div><div class="con" id="right_shengjintuifee">0</div></div>
        </div>
    </div>
    <div><?php include '../public/shrrbox.php'?></div>
</div>
<script>
    var param_id = getQueryVariable('id') || 0;

    layui.use(['form', 'layer', "laytp",'element','dropdown','laypage','table','soulTable'], function() {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable,element = layui.element;

        facade.ajax({url: ask_zhi_jintui_show, data:{id: param_id}}).done(function(res){
            if (res.code === 2000) {
                var data = res.data.data;
                var engininfo = res.data.engininfo;
                $("#flowdingname").text(data.zhai);

                if(engininfo){
                    $("#tong_enginname").text(engininfo.name);
                    $("#tong_lian_unit").text(engininfo.lian_unit);
                }
                $("#tong_number").text(data.number);
                $("#tong_money").text(parseFormatNum(data.money));
                $("#tong_duier").text(data.duier);


                if(engininfo){
                    $("#right_kou_shuifee").text(parseFormatNum(engininfo.kou_shuifee)).addClass('colorlan').click(function () {
                        openNavPage('查看费用扣收信息','lian_koulan/index.php?status=1&feitype_option=xmsr_lyfyhks_sf&enginid='+engininfo.id);
                    });
                    $("#right_shou_money").text(parseFormatNum(engininfo.shou_money)).addClass('colorlan').click(function () {
                        openNavPage('查看项目收票信息','piao_shou/index.php?status=1&enginid='+engininfo.id);
                    });
                    $("#right_shou_ratefee_zhuan").text(parseFormatNum(engininfo.shou_ratefee_zhuan)).addClass('colorlan').click(function () {
                        openNavPage('查看项目收票明细信息','piao_shou/detail.php?status=1&piaotype=1&enginid='+engininfo.id);
                    });
                    $("#right_zhijintuifee").text(parseFormatNum(engininfo.zhijintuifee)).addClass('colorlan').click(function () {
                        openNavPage('查看进项退税信息','zhi_jintui/index.php?status=1&enginid='+engininfo.id);
                    });
                    $("#right_shengjintuifee").text(parseFormatNum(engininfo.shengjintuifee));
                }






                var kuaninfo = res.data.kuaninfo;
                if(kuaninfo){
                    $("#paystate_name").text(kuaninfo.paystate_name);
                    $("#paylastdt").text(kuaninfo.paylastdt);
                    $("#payfee").text(parseFormatNum(kuaninfo.payfee)).addClass('colorlan').click(function () {
                        openNavPage('查看交易明细信息','account_list/index.php?kuanid='+kuaninfo.id);
                    });
                    $("#paynofee").text(parseFormatNum(kuaninfo.paynofee));
                }



                if(engininfo){
                    $("#enginid_name").text(engininfo.name).click(function () {
                        openPage('../engin/show.php?id='+engininfo.id);
                    });
                    $("#kou_shuifee").text(parseFormatNum(engininfo.kou_shuifee));
                    $("#shou_money").text(parseFormatNum(engininfo.shou_money));
                    $("#shou_ratefee_zhuan").text(parseFormatNum(engininfo.shou_ratefee_zhuan));
                    $("#zhijintuifee").text(parseFormatNum(engininfo.zhijintuifee));
                    $("#shengjintuifee").text(parseFormatNum(engininfo.shengjintuifee));
                }



                $("#number").text(data.number);
                $("#feilei_name").text(data.feilei_name);
                $("#feitype_name").text(data.feitype_name);
                $("#money").text(showChineseNumber(data.money));
                $("#zhai").text(data.zhai);
                $("#incdaotype_name").text(data.incdaotype_name);
                $("#duier").text(data.duier);
                $("#banknum").text(data.banknum);
                $("#bankname").text(data.bankname);
                $("#explain").text(data.explain);



                var mytableList = table.render({
                    elem: "#datalist_list",data:res.data.list, toolbar: '#toolbarDemo_list', page: false
                    ,limit:TabInitShow.limit,soulSort: TabInitShow.soulSort,method: TabInitShow.method, overflow: TabInitShow.overflow
                    ,defaultToolbar: TabInitShow.defaultToolbar,filter: TabInitShow.filter ,text: TabInitShow.text
                    ,request: TabInitShow.request,response: TabInitShow.response,contextmenu:get_table_contextmenu(soulTable)
                    , cols: [[
                        {type:'numbers',title:'序号',fixed:'left'}
                        ,{field: 'nums', title: '发票号码'}
                        ,{field: 'gonger', title: '开票单位'}
                        ,{field: 'piaotype_name', title: '发票类型'}
                        ,{field: 'fee', title: '不含税金额(元)',align:'right',templet: function(d){return parseFormatNum(d.fee);}}
                        ,{field: 'rate', title: '税率(%)'}
                        ,{field: 'ratefee', title: '税额(元)',align:'right',templet: function(d){return parseFormatNum(d.ratefee);}}
                        ,{field: 'piaomoney', title: '价税合计(元)',align:'right',templet: function(d){return parseFormatNum(d.piaomoney);}}
                        ,{field: 'money', title: '本次退税金额(元)',align:'right',templet: function(d){return parseFormatNum(d.money);}}
                        ,{field: 'explain', title: '备注'}
                    ]]
                    , done: function (res) {
                        soulTable.render(this);
                    }
                });


                public_flow_show_display(res.data.billinfo);
                public_upload_show_file('upload_files', res.data.files);
                render_from();
            }
        });

        public_get_readsandlog('zhi_jintui', param_id);
    });



</script>
</body>
</html>




